Option Explicit
'On Error Resume Next

Const msiViewModifyInsert         = 1
Const msiViewModifyUpdate         = 2
Const msiViewModifyAssign         = 3
Const msiViewModifyReplace        = 4
Const msiViewModifyDelete         = 6

If (WScript.Arguments.Count = 0) Then
   Msgbox("No command line argument specified for MSI location. Please try again.")
   Wscript.Quit 2
Else
 AdjustInstallUtil()
End If

 

public sub AdjustInstallUtil()
' On Error Resume Next
 
 dim msiInstance : msiInstance = WScript.Arguments.Item(0)
 dim installer : Set installer = CreateObject("WindowsInstaller.Installer")
 dim installerDb : Set installerDb = installer.OpenDatabase(cstr(msiInstance), 1)
 dim sqlCommand : sqlCommand = "SELECT * FROM Binary WHERE `Name`='InstallUtil'"
 dim view : Set view = installerDb.OpenView(sqlCommand)

 view.Execute()
 dim record : Set record = view.Fetch()

 If Not record Is Nothing Then
  const dataCol = 2
  record.SetStream dataCol, "C:\Documents and Settings\Administrator\My Documents\Visual Studio 2008\Projects\DistrRTgen\InstallUtilLib.dll"
  view.Modify msiViewModifyUpdate, record
  installerDb.Commit
 End IF
 
 'clean up
 Set installerDb = Nothing
 Set view = Nothing
 Set installer = Nothing
 
 'Error Handling
 If Err.number > 0 Then
   Msgbox("Error while adjusting x64 InstallUtilLib: " & Err.Description & ": " & Err.Source & ": " & Err.number)
 End If
end sub